package be.donovan.gui;

import java.awt.event.ActionEvent;

import be.donovan.gui.helper.ServiceLocator;
import be.donovan.gui.helper.components.AbstractController;

public class MenuController extends AbstractController<QuebakMenuBar> {

	@Override
	public void initData() {
		getView().getCreateMenu().add(createMenuItem("NewPerson"));
		getView().getCreateMenu().add(createMenuItem("AllPerson"));
		getView().getCreateMenu().add(createMenuItem("NewProduct"));
		getView().getCreateMenu().add(createMenuItem("AllProduct"));
		getView().getCreateMenu().add(createMenuItem("Faktuur"));
	}

	@Override
	public void initListeners() {

	}
	public void onNewPersonAction(ActionEvent ae){
		ServiceLocator.getService(ScreenController.class).openNewPersonScreen();
	}
	public void onAllPersonAction(ActionEvent ae){
		ServiceLocator.getService(ScreenController.class).openAllPersonScreen();
	}
	public void onNewProductAction(ActionEvent ae){
		ServiceLocator.getService(ScreenController.class).openNewProductScreen();
	}
	public void onAllProductAction(ActionEvent ae){
		ServiceLocator.getService(ScreenController.class).openAllProductsScreen();
	}
	public void onFaktuurAction(ActionEvent ae){
		ServiceLocator.getService(ScreenController.class).openFaktuurScreen();
	}
}
